import { api } from '@/request'
import { httpServer, PublishPageProps, PublishItem, publishPageParams, UserOperateBehaviorProps} from './api'

// 请求发布的列表数
export const publishPage: httpServer<publishPageParams, PublishPageProps> = (params) => {
  return api.get({
    url:`/api/publish/page`,
    params
  }
 )
}


// 新增一条发布数据
export const create: httpServer<PublishItem> = (data) => {
    return api.post({
      url:`/api/publish/create`,
      data
    }
   )
}



// 登录用户， 收藏，或者举报，或者助力
export const userOperateBehavior : httpServer<UserOperateBehaviorProps>= ({publish_id, data}) => {
  return api.put({
    url: `/api/publish/putReportOrCollectOrRocket/${publish_id}`,
    data
  })
}